% this is geometry of rib waveguide covered by SiO2 onGaAsSubstrte='n'; % otherwise on Si substrate %%%%%%%%%% main !!!!!!!!!!!!!!!!!!!!!!!!!! tCore=0.25; %um tClad=1.3; %um etchDepth=tCore; %0.2; %um wireWidth=0.8; %%%%%%%%%%%%%%%%%%%%%%%%% ButFillet=0.001; TopFillet=0.02; if onGaAsSubstrte=='y' xCore=0.3; xClad=0.5; onSiSubstrte='n'; else onSiSubstrte='y'; end CoveredBySiO2='n'; SiO2Thickness=0.2; %um CalculationWidth=wireWidth+2; CutLinePos=-0.3; % um position where transverse refractive index is calculated AirAbove=0.5; %um Air above UseGaAs='n'; GaAsThickness=0.5; if UseGaAs=='n'; GaAsThickness=0;end disp('geometry started') %%%%%%%%%%%%%% geometry if UseGaAs=='y'; nAprox=(nAlGaAs(xClad,lambda)+nAlGaAs(xCore,lambda))/2; else nAprox=(nSi(lambda)+nSiO2(lambda))/2 ; nAprox=2.8; end model.param.set('nAprox', num2str(nAprox),'aproximate of refractive index'); model.param.set('lambda', [num2str(lambda) '[um]'],'wavelength'); model.param.set('CoreThickness', [num2str(tCore) '[um]'],'thickness of AlGaAsCore'); model.param.set('AlGaAsCladThickness', [num2str(tClad) '[um]'],'thickness of AlGaAs clad'); if UseGaAs=='y'; model.param.set('GaAsThickness', [num2str(GaAsThickness) '[um]'],'thickness of sub (calculution window');end; model.param.set('SiO2Cover', [num2str(SiO2Thickness) '[um]'],'thickness of SiO2 cover'); model.param.set('WireWidth',[num2str(wireWidth) '[um]'], 'width of main wire'); model.param.set('EtchingDepth',[num2str(etchDepth) '[um]'], 'should be larger than core'); model.param.set('CalculationWidth',[num2str(CalculationWidth) '[um]'], 'width of main wire'); model.param.set('AirAbove',[num2str(AirAbove) '[um]'], 'air above top of SiO2'); geom1 = model.geom.create('geom1', 2); model.geom('geom1').lengthUnit([native2unicode(hex2dec('00b5'), 'Cp1252') 'm']); % set length unit in um % zero at boundary core and clad layers if UseGaAs=='y' % GaAs sub r1=model.geom('geom1').feature.create('r1', 'Rectangle'); r1.set('size',{'CalculationWidth' 'GaAsThickness'}); r1.set('pos',{'-CalculationWidth/2' '-GaAsThickness-AlGaAsCladThickness'}); geom1.run model.geom('geom1').feature().create('sel1', 'Selection'); model.geom('geom1').feature('sel1').selection('selection').set('r1',1); end % AlGaAs clad before etch r2=model.geom('geom1').feature.create('r2', 'Rectangle'); r2.set('size',{'CalculationWidth' 'AlGaAsCladThickness'}); r2.set('pos',{'-CalculationWidth/2' '-AlGaAsCladThickness'}); % AlGaAs core before etch r3=model.geom('geom1').feature.create('r3', 'Rectangle'); r3.set('size',{'CalculationWidth' 'CoreThickness'}); r3.set('pos',{'-CalculationWidth/2' '0'}); %etching rib r4=model.geom('geom1').feature.create('r4', 'Rectangle'); r4.set('size',{'WireWidth' 'EtchingDepth'}); r4.set('pos',{'-WireWidth/2' 'CoreThickness-EtchingDepth'}); %etching rib r5=model.geom('geom1').feature.create('r5', 'Rectangle'); r5.set('size',{'CalculationWidth' 'EtchingDepth'}); r5.set('pos',{'-CalculationWidth/2' 'CoreThickness-EtchingDepth'}); geom1.run; model.geom('geom1').feature.create('dif1', 'Difference'); model.geom('geom1').feature('dif1').selection('input').set({'r5'}); model.geom('geom1').feature('dif1').selection('input2').set({'r4'}); model.geom('geom1').feature('dif1').set('keep', 'on'); geom1.run model.geom('geom1').feature.create('fil2', 'Fillet'); model.geom('geom1').feature('fil2').selection('point').set('dif1', [3 5]); model.geom('geom1').feature('fil2').set('radius', num2str(ButFillet)); % fil2 is what etched from gaas model.geom('geom1').feature.create('dif1a', 'Difference'); model.geom('geom1').feature('dif1a').selection('input').set({'r5'}); model.geom('geom1').feature('dif1a').selection('input2').set({'r4'}); geom1.run; % AlGaAs core after etch model.geom('geom1').feature.create('dif2', 'Difference'); model.geom('geom1').feature('dif2').selection('input').set({'r3'}); model.geom('geom1').feature('dif2').selection('input2').set({'fil2'}); % AlGaAs cclad after etch model.geom('geom1').feature.create('dif3', 'Difference'); model.geom('geom1').feature('dif3').selection('input').set({'r2'}); model.geom('geom1').feature('dif3').selection('input2').set({'dif1a'}); geom1.run; model.geom('geom1').feature().create('sel2', 'Selection'); model.geom('geom1').feature('sel2').selection('selection').set('dif3',1); model.geom('geom1').feature.create('fil1', 'Fillet'); model.geom('geom1').feature('fil1').selection('point').set('dif2', [3 5]); model.geom('geom1').feature('fil1').set('radius', num2str(TopFillet)); geom1.run; model.geom('geom1').feature().create('sel3', 'Selection'); model.geom('geom1').feature('sel3').selection('selection').set('fil1',1); % SiO2 cover if CoveredBySiO2=='y' r6=model.geom('geom1').feature.create('r6', 'Rectangle'); r6.set('size',{'WireWidth+2*SiO2Cover' 'EtchingDepth+SiO2Cover'}); r6.set('pos',{'-WireWidth/2-SiO2Cover' 'CoreThickness-EtchingDepth'}); geom1.run; model.geom('geom1').feature.create('fil6', 'Fillet'); model.geom('geom1').feature('fil6').selection('point').set('r6', [1 2]); model.geom('geom1').feature('fil6').set('radius', 'TopFillet'); r7=model.geom('geom1').feature.create('r7', 'Rectangle'); r7.set('size',{'CalculationWidth' 'SiO2Cover'}); r7.set('pos',{'-CalculationWidth/2' 'CoreThickness-EtchingDepth'}); geom1.run; model.geom('geom1').feature.create('uni1', 'Union'); model.geom('geom1').feature('uni1').selection('input').set({'fil6' 'r7'}); model.geom('geom1').feature('uni1').set('intbnd', 'off'); geom1.run; model.geom('geom1').feature().create('sel4', 'Selection'); model.geom('geom1').feature('sel4').selection('selection').set('uni1',1); end % air r8=model.geom('geom1').feature.create('r8', 'Rectangle'); r8.set('size',{'CalculationWidth' 'EtchingDepth+AirAbove'}); %r8.set('pos',{'-CalculationWidth/2' 'CoreThickness-EtchingDepth+SiO2Cover'}); r8.set('pos',{'-CalculationWidth/2' 'CoreThickness-EtchingDepth'}); geom1.run; if CoveredBySiO2=='y' model.geom('geom1').feature.create('copy1', 'Copy'); model.geom('geom1').feature('copy1').selection('input').set({'uni1'}); model.geom('geom1').feature.create('dif4', 'Difference'); model.geom('geom1').feature('dif4').selection('input').set({'r8'}); model.geom('geom1').feature('dif4').selection('input2').set({'copy1'}); geom1.run; model.geom('geom1').feature().create('sel5', 'Selection'); model.geom('geom1').feature('sel5').selection('selection').set('dif4',1); else model.geom('geom1').feature().create('sel5', 'Selection'); model.geom('geom1').feature('sel5').selection('selection').set('r8',1); end %%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%% materials %AlGaAs core model.material.create('mat1'); if onGaAsSubstrte=='y';model.material('mat1').name('AlGaAs core');else; model.material('mat1').name('Si core');end model.material('mat1').propertyGroup.create('RefractiveIndex', 'Refractive index'); if onGaAsSubstrte=='y'; model.material('mat1').propertyGroup('RefractiveIndex').set('n', {num2str(nAlGaAs(xCore,lambda)')}); else model.material('mat1').propertyGroup('RefractiveIndex').set('n', {num2str(nSi(lambda)')}); end model.material('mat1').selection.set([model.selection('geom1_sel3').entities(2);]); %AlGaAs clad model.material.create('mat2'); if onGaAsSubstrte=='y';model.material('mat2').name('AlGaAs clad');else;model.material('mat2').name('SiO2 clad');end model.material('mat2').propertyGroup.create('RefractiveIndex', 'Refractive index'); if onGaAsSubstrte=='y'; model.material('mat2').propertyGroup('RefractiveIndex').set('n', {num2str(nAlGaAs(xClad,lambda)')}); else model.material('mat2').propertyGroup('RefractiveIndex').set('n', {num2str(nSiO2(lambda)')}); end model.material('mat2').selection.set([model.selection('geom1_sel2').entities(2);]); if UseGaAs=='y' %GaAs core model.material.create('mat3'); model.material('mat3').name('GaAs sub'); model.material('mat3').propertyGroup.create('RefractiveIndex', 'Refractive index'); model.material('mat3').propertyGroup('RefractiveIndex').set('n', {num2str(nAlGaAs(0,lambda)')}); model.material('mat3').selection.set([model.selection('geom1_sel1').entities(2);]); end %SiO2 cover if CoveredBySiO2=='y' model.material.create('mat4'); model.material('mat4').name('SiO2 cover'); model.material('mat4').propertyGroup.create('RefractiveIndex', 'Refractive index'); model.material('mat4').propertyGroup('RefractiveIndex').set('n', {num2str(nSiO2(lambda))}); model.material('mat4').selection.set([model.selection('geom1_sel4').entities(2);]); end %air model.material.create('mat5'); model.material('mat5').name('air'); model.material('mat5').propertyGroup.create('RefractiveIndex', 'Refractive index'); model.material('mat5').propertyGroup('RefractiveIndex').set('n', {'1'}); model.material('mat5').selection.set([model.selection('geom1_sel5').entities(2);]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% % create mesh % create mesh mesh1=model.mesh.create('mesh1', 'geom1'); meshSize=mesh1.feature('size'); meshSize.set('hauto', '2'); mesh1.feature.create('ftri1', 'FreeTri'); mesh1.run; mesh1.data.transferMesh; disp('geometry OK')